/* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Send-Message-Related-APIs
短信发送相关API

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/

#import <Foundation/Foundation.h>
#import <JDCloudOCSDKSms/SmsApiModel.h>


@implementation SmsStatusReportRequest
-(id) initWithRegion:(NSString *)regionId
sequenceNumber:(NSString*)sequenceNumber
phoneList:(NSArray<NSString*>*)phoneList { 
    self.regionId = regionId;
    self.sequenceNumber = sequenceNumber;
    self.phoneList = phoneList;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
sequenceNumber:(NSString*)sequenceNumber
phoneList:(NSArray<NSString*>*)phoneList { 
    self.regionId = regionId;
    self.version = version;
    self.sequenceNumber = sequenceNumber;
    self.phoneList = phoneList;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self sequenceNumber])
    {
        [result setValue:[self sequenceNumber] forKey:@"sequenceNumber"];
    }
    if([self phoneList])
    {
        [result setValue:[self phoneList] forKey:@"phoneList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.sequenceNumber = [dictionary objectForKey:@"sequenceNumber"];
    self.phoneList = [dictionary objectForKey:@"phoneList"];
    return self;
} 

@end
@implementation SmsReplyRequest
-(id) initWithRegion:(NSString *)regionId
appId:(NSString*)appId
dataDate:(NSString*)dataDate
phoneList:(NSArray<NSString*>*)phoneList { 
    self.regionId = regionId;
    self.appId = appId;
    self.dataDate = dataDate;
    self.phoneList = phoneList;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
appId:(NSString*)appId
dataDate:(NSString*)dataDate
phoneList:(NSArray<NSString*>*)phoneList { 
    self.regionId = regionId;
    self.version = version;
    self.appId = appId;
    self.dataDate = dataDate;
    self.phoneList = phoneList;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self appId])
    {
        [result setValue:[self appId] forKey:@"appId"];
    }
    if([self dataDate])
    {
        [result setValue:[self dataDate] forKey:@"dataDate"];
    }
    if([self phoneList])
    {
        [result setValue:[self phoneList] forKey:@"phoneList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.appId = [dictionary objectForKey:@"appId"];
    self.dataDate = [dictionary objectForKey:@"dataDate"];
    self.phoneList = [dictionary objectForKey:@"phoneList"];
    return self;
} 

@end
@implementation SmsBatchSendRequest
-(id) initWithRegion:(NSString *)regionId
templateId:(NSString*)templateId
signId:(NSString*)signId
phoneList:(NSArray<NSString*>*)phoneList
params:(NSArray<NSString*>*)params { 
    self.regionId = regionId;
    self.templateId = templateId;
    self.signId = signId;
    self.phoneList = phoneList;
    self.params = params;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
templateId:(NSString*)templateId
signId:(NSString*)signId
phoneList:(NSArray<NSString*>*)phoneList
params:(NSArray<NSString*>*)params { 
    self.regionId = regionId;
    self.version = version;
    self.templateId = templateId;
    self.signId = signId;
    self.phoneList = phoneList;
    self.params = params;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self templateId])
    {
        [result setValue:[self templateId] forKey:@"templateId"];
    }
    if([self signId])
    {
        [result setValue:[self signId] forKey:@"signId"];
    }
    if([self phoneList])
    {
        [result setValue:[self phoneList] forKey:@"phoneList"];
    }
    if([self params])
    {
        [result setValue:[self params] forKey:@"params"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.templateId = [dictionary objectForKey:@"templateId"];
    self.signId = [dictionary objectForKey:@"signId"];
    self.phoneList = [dictionary objectForKey:@"phoneList"];
    self.params = [dictionary objectForKey:@"params"];
    return self;
} 

@end
@implementation SmsStatusReportResult
-(id) initWithData:(NSArray<StatusReportResp*>*) data
        status:(NSNumber*)status
        code:(NSString*)code
        message:(NSString*)message { 
    self.data = data;               
    self.status = status;               
    self.code = code;               
    self.message = message;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self data])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self data] count]; i++) {
            StatusReportResp* item = [[self data] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"data"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self code])
    {
        [result setValue:[self code] forKey:@"code"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* dataArray = [dictionary objectForKey:@"data"];
    if(dataArray&&![dataArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataArray count];i++)
        {
        StatusReportResp* item = [[StatusReportResp alloc]initWithDic:[dataArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.data = propertyArray;
    }
    self.status = [dictionary objectForKey:@"status"];
    self.code = [dictionary objectForKey:@"code"];
    self.message = [dictionary objectForKey:@"message"];
    return self;
} 

@end
  
@implementation SmsStatusReportResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
SmsStatusReportResult* result = [[SmsStatusReportResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(SmsStatusReportResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation SmsBatchSendResult
-(id) initWithData:(BatchSendResp*) data
        status:(NSNumber*)status
        code:(NSString*)code
        message:(NSString*)message { 
    self.data = data;               
    self.status = status;               
    self.code = code;               
    self.message = message;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self data])
    {
        [result setValue:[[self data] dictionary]forKey:@"data"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self code])
    {
        [result setValue:[self code] forKey:@"code"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.data = [[BatchSendResp alloc]initWithDic:[dictionary objectForKey:@"data"]];
    self.status = [dictionary objectForKey:@"status"];
    self.code = [dictionary objectForKey:@"code"];
    self.message = [dictionary objectForKey:@"message"];
    return self;
} 

@end
  
@implementation SmsBatchSendResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
SmsBatchSendResult* result = [[SmsBatchSendResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(SmsBatchSendResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation SmsReplyResult
-(id) initWithData:(NSArray<ReplyResp*>*) data
        status:(NSNumber*)status
        code:(NSString*)code
        message:(NSString*)message { 
    self.data = data;               
    self.status = status;               
    self.code = code;               
    self.message = message;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self data])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self data] count]; i++) {
            ReplyResp* item = [[self data] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"data"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self code])
    {
        [result setValue:[self code] forKey:@"code"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* dataArray = [dictionary objectForKey:@"data"];
    if(dataArray&&![dataArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataArray count];i++)
        {
        ReplyResp* item = [[ReplyResp alloc]initWithDic:[dataArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.data = propertyArray;
    }
    self.status = [dictionary objectForKey:@"status"];
    self.code = [dictionary objectForKey:@"code"];
    self.message = [dictionary objectForKey:@"message"];
    return self;
} 

@end
  
@implementation SmsReplyResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
SmsReplyResult* result = [[SmsReplyResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(SmsReplyResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
 
